Skip to content

[WIP Draft] The HDR mega-PR#110701

Closed
allenwp wants to merge 8 commits into
godotengine:masterfrom
allenwp:rendering/hdr-output-combined-prs
Closed

[WIP Draft] The HDR mega-PR#110701
allenwp wants to merge 8 commits into
godotengine:masterfrom
allenwp:rendering/hdr-output-combined-prs

Conversation

@allenwp
Copy link
Copy Markdown
Contributor

@allenwp allenwp commented Sep 19, 2025

Update: There is no longer any need for this PR, as many of the PRs that this one combined have been merged into master. #94496 now has all of these merged in!

This is a combination of the following PRs, merged in no particular order, for the purpose of testing how these PRs work together:

Usage

Download the editor build artifact from the Checks page of this PR.

Note: Mac OS builds fine if you build it yourself, but fails on Checks, so no build artifact is made.

This PR only supports HDR on Windows, Wayland, and Mac OS for now. SDR testing on other platforms is welcome!

Windows

Usage on Windows is the similar to #94496 (the difference is now AgX tonemapper supports HDR):

  1. Set HDR 2D to enabled to ensure consistent 2D rendering between SDR and HDR modes
  2. Change rendering driver to d3d12 to avoid vulkan GPU driver issues on Windows
  3. Change tonemapper to Linear, Reinhard, or AgX (Filmic and ACES cannot work in HDR)
  4. Set display/window/request_hdr to enabled!

Mac OS

Usage on Mac OS has its own quirks as this is a very early rough prototype:

  1. Build Mac OS editor locally
  2. Set HDR 2D to enabled to ensure consistent 2D rendering between SDR and HDR modes
  3. Disable "Embed game on next play" under the Game workspace (Embedded windows are currently not supported!)
  4. Change tonemapper to Linear, Reinhard, or AgX (Filmic and ACES cannot work in HDR)
  5. Set display/window/request_hdr to enabled!
  6. Note: Sometimes Godot will think that HDR output is supported when it is not.

Linux (Wayland)

  1. Enable the wayland server within Godot
  2. Set HDR 2D to enabled to ensure consistent 2D rendering between SDR and HDR modes
  3. Change tonemapper to Linear, Reinhard, or AgX (Filmic and ACES cannot work in HDR)
  4. Set display/window/request_hdr to enabled!

Player settings (max luminance and brightness)

Brightness on Windows is controlled by the OS HDR display settings (“SDR content brightness” or “HDR content brightness”). Brightness on Mac OS is controlled also controlled by the brightness display settings.

Max luminance, used by tonemapping and glow effects, is read from screen information or can be overridden by the player (on Windows only currently) by using the “player facing HDR settings” found in this demo project. You can also adjust this using the project settings by disabling the “auto-adjust luminance” settings.

Things to try

Please give this "mega-PR" a try, especially relating to all combinations the following which have been changed:

  • Does HDR mode look the same as SDR mode, but with brighter highlights? (It should!)
  • Glow (especially the Screen blend mode, which is now influenced by both tonemapper white and HDR output max value)
  • AgX tonemapping
  • HDR output with the Mobile renderer
  • Colour adjustments

Performance

Optimizations have not been included in this PR and there is room for improvement. Testing performance would be better done on #94496.

@jcostello
Copy link
Copy Markdown
Contributor

Looking good. Didn't find any issue. Tho white doesn't seems to do anything in agx

@allenwp
Copy link
Copy Markdown
Contributor Author

allenwp commented Sep 19, 2025

Looking good. Didn't find any issue. Tho white doesn't seems to do anything in agx

Hmm. That’s not right. Would you mind setting your maximum luminance in the Window project settings to be something like 400 and see if that fixes the issue you’re seeing with AgX white not doing anything?

@allenwp
Copy link
Copy Markdown
Contributor Author

allenwp commented Sep 19, 2025

Looking good. Didn't find any issue. Tho white doesn't seems to do anything in agx

Hmm. That’s not right. Would you mind setting your maximum luminance in the Window project settings to be something like 400 and see if that fixes the issue you’re seeing with AgX white not doing anything?

Oh, or did you mean it doesn't do anything in SDR or HDR? Its minimum value is 2.0 and it should only have an impact on how highlights appear.

@jcostello
Copy link
Copy Markdown
Contributor

Looking good. Didn't find any issue. Tho white doesn't seems to do anything in agx

Hmm. That’s not right. Would you mind setting your maximum luminance in the Window project settings to be something like 400 and see if that fixes the issue you’re seeing with AgX white not doing anything?

Oh, or did you mean it doesn't do anything in SDR or HDR? Its minimum value is 2.0 and it should only have an impact on how highlights appear.

I have HDR enabled. Im on Linux BTW

@allenwp
Copy link
Copy Markdown
Contributor Author

allenwp commented Sep 20, 2025

I have HDR enabled. Im on Linux BTW

Ah, I see! I haven't merged the Linux HDR support into this combined branch, so I expect only SDR will work well on Linux. Let me know do you find any issues with SDR.

Thanks!

@jcostello
Copy link
Copy Markdown
Contributor

Do you have a PR for HDR in linux?

@allenwp
Copy link
Copy Markdown
Contributor Author

allenwp commented Sep 20, 2025

Do you have a PR for HDR in linux?

I haven't tested these yet, but some draft PRs exist:

They don't include the other related PRs that this "mega-PR" does, though, so please comment on those PRs if you have any thoughts that come up relating to HDR on those platforms. Thanks!

@allenwp
Copy link
Copy Markdown
Contributor Author

allenwp commented Sep 22, 2025

@jcostello @betalars I've merged in the Linux support PR by @ArchercatNEO. I haven't tested this myself at all, but since a number of people seem to be testing on Linux, hopefully this is helpful.

@allenwp
Copy link
Copy Markdown
Contributor Author

allenwp commented Sep 22, 2025

Also, it seems like I broke color correction LUT in Compatibility renderer when I merged in the colour adjustments PR. This bug doesn't reproduce in the original PR, so it must have been a bad merge. I can't immediately track down what I messed up, so I'm going to leave it for now, given I'll need to re-merge it at some point when it's finished anyway.

@allenwp
Copy link
Copy Markdown
Contributor Author

allenwp commented Sep 26, 2025

I've updated this PR to include the latest from #110671 and #110630. I've also added the early draft prototype for Mac OS HDR output.

Unfortunately, I've needed to remove the Linux (wayland) PR for now because it breaks Vulkan support on Windows (we won't be shipping this anyway, but it makes for a difficult testing experience on Windows if you try to enable HDR output with default project settings.

Edit: Build artifact for Mac OS fails checks, so you'll have to build it yourself to test this for now...

@allenwp allenwp force-pushed the rendering/hdr-output-combined-prs branch 2 times, most recently from 572b2c4 to 52894c8 Compare October 2, 2025 19:17
@allenwp
Copy link
Copy Markdown
Contributor Author

allenwp commented Oct 2, 2025

I've pulled in the latest changes from the PRs that this one combines.

@ArchercatNEO
Copy link
Copy Markdown
Contributor

Unfortunately, I've needed to remove the Linux (wayland) PR for now because it breaks Vulkan support on Windows (we won't be shipping this anyway, but it makes for a difficult testing experience on Windows if you try to enable HDR output with default project settings.

@allenwp I have pushed a change which should hopefully mean this is no longer the case and the linux PR can be added back in.

@allenwp allenwp force-pushed the rendering/hdr-output-combined-prs branch from 52894c8 to 0008dc6 Compare October 3, 2025 20:25
@allenwp
Copy link
Copy Markdown
Contributor Author

allenwp commented Oct 3, 2025

@allenwp I have pushed a change which should hopefully mean this is no longer the case and the linux PR can be added back in.

Nice, thanks! I did a quick test and confirmed that it doesn't appear to be broken anymore! I've pushed an update that includes the latest Wayland PR.

All this means that this PR supports Windows, Linux (Wayland), and Mac OS! (Only catch is you need to build Mac OS yourself right now).

@betalars
Copy link
Copy Markdown
Contributor

betalars commented Oct 3, 2025

Testing now on both Linux and Max. So far I am only getting some wayland specific issues. (I think that has to do more with the state of godot wayland and not hdr)

@allenwp allenwp force-pushed the rendering/hdr-output-combined-prs branch from 0008dc6 to faa42e8 Compare October 6, 2025 15:52
@ArchercatNEO
Copy link
Copy Markdown
Contributor

Testing now on both Linux and Max. So far I am only getting some wayland specific issues. (I think that has to do more with the state of godot wayland and not hdr)

Could you elaborate on what the issues are? Even if they're godot wayland issues they should be addressed and having bug reports is good.

Just in case, quick checklist from other issues.

  1. You've definitely enabled the wayland server within godot? One of the remaining issues is warning if you try to use X11 and HDR but so far we don't have consensus on that.
  2. What compositor/version are you using? KDE Plasma 4.3+ is known working and there where some other issues with GNOME, not sure how other compositors fare with HDR so far.

@betalars
Copy link
Copy Markdown
Contributor

betalars commented Oct 7, 2025

Could you elaborate on what the issues are? Even if they're godot wayland issues they should be addressed and having bug reports is good.

There was some error spam that I read about in another PR/issue thread already so I did not bother to investigate further. Also I think the sizing of popup windows was a bit over the place at times. Can look into it. From what I've read wayland support seemed experimental. But if this is a misunderstanding, I will be more vigilant for weird behavior.

If I find anything new, I will make sure to see if there's an issue for that and if not make a new one.

am on kde

DarkKilauea and others added 2 commits October 23, 2025 14:16
Co-authored-by: Alvin Wong <alvinhochun@gmail.com>
Co-authored-by: Allen Pestaluky <allenpestaluky@gmail.com>
@allenwp allenwp force-pushed the rendering/hdr-output-combined-prs branch from faa42e8 to b7b19da Compare October 23, 2025 19:04
allenwp and others added 5 commits October 23, 2025 15:24
Also optimize all tonemappers to perform less calculations per-pixel.

Note: unlike `white`, `agx_white` is limited to a minimum of `2.0` and defaults to `16.29`. When using a RGB10A2 render buffer, `agx_white` will be ignored and a value of `2.0` will be used instead to ensure good behavior on the Mobile renderer.

# Conflicts:
#	drivers/gles3/rasterizer_scene_gles3.cpp
#	servers/rendering/renderer_rd/effects/tone_mapper.h
#	servers/rendering/renderer_rd/renderer_scene_render_rd.cpp
#	servers/rendering/renderer_rd/shaders/effects/tonemap.glsl
#	servers/rendering/renderer_scene_cull.h
#	servers/rendering/renderer_scene_render.cpp
#	servers/rendering/renderer_scene_render.h
#	servers/rendering/rendering_method.h
#	servers/rendering/storage/environment_storage.cpp
#	servers/rendering/storage/environment_storage.h
@allenwp
Copy link
Copy Markdown
Contributor Author

allenwp commented Dec 6, 2025

Now that the changes to environment and the AgX update has been merged into master and also the main HDR output PR, there is no longer a strong need for this PR that combines all of them.

@allenwp allenwp closed this Dec 6, 2025
@AThousandShips AThousandShips removed this from the 4.x milestone Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants